<nav class="navbar navbar-inverse" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <a class="navbar-brand" href="/">booklist</a>
        </div>
        <ul class="nav navbar-nav">
            <li class="active"><a href="#">Home</a></li>
            <li><a href="#">实验室</a></li>
        </ul>

        <ul class="nav navbar-nav navbar-right">
            <% if (hasOwnProperty("user") && user) { %>
            <li class="dropdown">
                <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown"><%= user.name %> <span class="caret"></span></a>
                <ul class="dropdown-menu" role="menu">
                    <li role="presentation"><a role="menuitem" tabindex="-1" href="#">个人资料</a></li>
                    <li role="presentation"><a role="menuitem" tabindex="-1" href="/login/logout">退出</a></li>
                </ul>
            </li>
            <% } else { %>
            <li><a href="/login">登录/注册</a></li>
            <% } %>
        </ul>
        <form class="navbar-form navbar-right" role="search" action="/search">
            <div class="form-group">
                <input type="text" class="form-control" placeholder="Search">
            </div>
        </form>
    </div>
</nav>